#!/bin/bash

if [ "$2" == "" ]; then
    echo "Usage: $0 <python version> <tg version>"
    echo
    echo "Where - <python version> = 2.5, 2.7"
    echo "      - <tg version> = 1.1"
    
    exit 0
fi

if [ "$1" == "2.5" ]; then
    PYTHON=python2.5
    WEBOB="WebOb<1.1.99"
    ENV=py25
fi

if [ "$1" == "2.7" ]; then
    PYTHON=python2.7
    WEBOB="WebOb"
    ENV=py27
fi

if [ "$2" == "1.1" ]; then
    INDEX=http://www.turbogears.org/1.1/downloads/current/index
    ENV="${ENV}tg11"
fi

virtualenv -p $PYTHON .test/$ENV

.test/$ENV/bin/easy_install nose coverage "$WEBOB" webtest
.test/$ENV/bin/easy_install -i $INDEX TurboGears

.test/$ENV/bin/python setup.py develop -i $INDEX
